package com.tencent.sr.iris.basic.mp.restapi.controller;

import com.tencent.sr.iris.basic.mp.service.QfCommonReportService;
import com.tencent.sr.iris.basic.service.interfaces.request.QfCommonDataReportRequest;
import com.tencent.sr.rmall.common.primitive.HttpResult;
import com.tencent.sr.rmall.springbootstarter.authtoken.localbean.AppUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@Api("区发通用接口")
@RequestMapping("/iris/basic/mp/v1/qf/common")
public class QfCommonController {

    @Resource
    private QfCommonReportService qfCommonReportService;

    @Resource
    private AppUser appUser;

    @PostMapping("/report")
    @ApiOperation("区发通用接口")
    public HttpResult<Object> commonDataReport(@RequestBody @Validated QfCommonDataReportRequest request) {
        request.setUid(appUser.getUid());
        return qfCommonReportService.commonDataReport(request);
    }
}
